<template>
    <article>
        <h1 class="t_nav"><router-link to="/blog/home" class="n1">网站首页</router-link><router-link to="blog/comment" class="n2">留言板</router-link></h1>
        <div class="bloglist">
            <ul class="arrow_box" v-for="data in tableData">
                <div class="sy">
                    <p> {{data.body}}</p>
                </div>
                <span class="dateview">{{data['created_at']}}</span>
            </ul>
        </div>
        <el-col :span="24"
                class="toolbar"
                style="margin-top:20px;">
            <el-pagination layout="prev, pager, next"
                           :page-size="pagesize"
                           :total="total"
                           :current-page="currentpage"
                           @current-change="pageHandle">
            </el-pagination>
        </el-col>
    </article>
</template>
<script>
import article_item from './article_item.vue'
import aside_right from './aside_right.vue'
export default {
    components: {
        'article-item': article_item,
        'aside-right': aside_right,
    },
    data() {
        return {
            username: 'JimCreen',
            tableData: [],
            currentpage:1,
            total:1,
            pagesize:1
        }
    },
    created() {
        api.getData('api/comment', this);
    },
    methods: {
        getUser: function (id) {
            return id
        },
        pageHandle(val) {
            api.getDataByPage('api/comment', val, this);
        }
    }
}
</script>
<style lang="scss" scoped>
h1.t_nav span {
    float: right;
    color: #999
}

h1.t_nav {
    border-bottom: #F1F1F1 1px solid;
    font-size: 12px;
    font-weight: normal;
    line-height: 40px;
    height: 40px;
    margin: 20px auto;
    width: 1000px
}

h1.t_nav a {
    width: 100px;
    display: block;
    text-align: center;
    color: #fff;
    float: left
}

.n1 {
    background: #5EA51B;
}

.n2 {
    background: #8BBF5D;
}

.bloglist {
    width: 1000px;
    margin: 0 auto;
    background: url(./images/r_title_bg.jpg) repeat-y 764px 0;
    overflow: hidden;
}

.arrow_box {
    background: #f8f8f8;
    box-shadow: 0px 1px 0px rgba(255, 255, 255, .1), inset 0px 1px 1px rgba(214, 214, 214, 0.7);
    width: 730px;
    border-radius: 6px;
    position: relative;
    padding: 20px 0;
    margin: 20px 0;
}

.arrow_box img {
    width: 150px;
    float: left;
    margin: 0 20px 0 20px;
}

.arrow_box p {
    background: #f8f8f8;
    line-height: 24px;
    padding: 0 20px 20px
}

.arrow_box::before {
    content: "";
    width: 0px;
    height: 0px;
    border-style: solid;
    border-width: 0px 0 20px 22px;
    border-color: transparent transparent transparent #fff;
    position: absolute;
    left: 730px;
    top: 23px;
}

.arrow_box::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    left: 758px;
    top: 16px;
    background: #CCCCCE;
    border: 2px solid #fff;
    transition: all 0.5s;
}


.arrow_box:hover::before {
    border-color: transparent transparent transparent #CECCCD
}


.arrow_box:hover::after {
    border: #fff 2px solid;
    background: #5EA51B
}

.arrow_box:hover {
    background: #f4f2f2;
    color: #333;
    text-shadow: #f7f7f7 1px 1px 1px;
    p{
        background: #f4f2f2;
    }
}



.dateview {
    position: absolute;
    left: 788px;
    top: 20px;
    width: 125px;
    line-height: 30px;
    background: #5EA51B;
    border-radius: 0px 40px;
    text-align: center;
    color: #fff
}

.sy {
    overflow: hidden
}
</style>